const values_default = {}

const domain_default = {}

const fields_default = {
  word_id: null,
  word_name: null,
  part_of_speech: null,
  number: null,
  name: null,
  meaning: null,
  meaning_cn: null
}

const filterItems = [
  { type: 'input', name: 'word_name___like', placeholder: 'Word' }
]

const columns = [
  { name: 'word_name', type: 'char', label: 'Word' },
  { name: 'part_of_speech', type: 'char', label: 'Part of Speech' },
  { name: 'number', type: 'char', label: 'No' },
  { name: 'meaning', type: 'char', label: 'Meaning' },
  { name: 'meaning_cn', type: 'char', label: 'Meaning CN' }
]

const formItems = [
  {
    type: 'select',
    name: 'word_id',
    label: 'Word',
    placeholder: 'Word',
    filterable: true
  },
  { type: 'input', name: 'number', label: 'No' },
  {
    type: 'input',
    name: 'meaning',
    label: 'Meaning',
    rules: { required: false }
  },
  {
    type: 'input',
    name: 'meaning_cn',
    label: 'Meaning CN',
    rules: { required: false }
  }
]

const Model = {
  configs: {
    values_default,
    domain_default,
    fields_default,
    filterItems,
    columns,
    formItems
  },

  extend: BaseClass => {
    class ModelClass extends BaseClass {
      global_domain(domain = {}) {
        return super.global_domain(domain)
      }
    }
    return ModelClass
  }
}

export default Model
